package cn.edu.imau.zy.system.service.impl;

import java.util.List;
import java.util.Map;

import cn.edu.imau.zy.common.utils.DateUtils;
import cn.edu.imau.zy.system.dto.ClassTeacher;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.edu.imau.zy.system.mapper.TcTeacherMapper;
import cn.edu.imau.zy.common.core.entity.teacher.TcTeacher;
import cn.edu.imau.zy.system.service.ITcTeacherService;
import cn.edu.imau.zy.common.core.text.Convert;

/**
 * 教师信息Service业务层处理
 * 
 * @author wyz
 * @date 2020-06-23
 */
@Service
public class TcTeacherServiceImpl extends ServiceImpl<TcTeacherMapper,TcTeacher> implements ITcTeacherService
{
    @Autowired
    private TcTeacherMapper tcTeacherMapper;

    /**
     * 查询教师信息
     * 
     * @param teacherId 教师信息ID
     * @return 教师信息
     */
    @Override
    public TcTeacher selectTcTeacherById(Long teacherId)
    {
        return tcTeacherMapper.selectTcTeacherById(teacherId);
    }

    /**
     * 查询教师信息列表
     * 
     * @param tcTeacher 教师信息
     * @return 教师信息
     */
    @Override
    public List<TcTeacher> selectTcTeacherList(TcTeacher tcTeacher)
    {
        return tcTeacherMapper.selectTcTeacherList(tcTeacher);
    }

    /**
     * 新增教师信息
     * 
     * @param tcTeacher 教师信息
     * @return 结果
     */
    @Override
    public int insertTcTeacher(TcTeacher tcTeacher)
    {
        tcTeacher.setCreateTime(DateUtils.getNowDate());
        return tcTeacherMapper.insertTcTeacher(tcTeacher);
    }

    /**
     * 修改教师信息
     * 
     * @param tcTeacher 教师信息
     * @return 结果
     */
    @Override
    public int updateTcTeacher(TcTeacher tcTeacher)
    {
        tcTeacher.setUpdateTime(DateUtils.getNowDate());
        return tcTeacherMapper.updateTcTeacher(tcTeacher);
    }

    /**
     * 删除教师信息对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteTcTeacherByIds(String ids)
    {
        return tcTeacherMapper.deleteTcTeacherByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除教师信息信息
     * 
     * @param teacherId 教师信息ID
     * @return 结果
     */
    @Override
    public int deleteTcTeacherById(Long teacherId)
    {
        return tcTeacherMapper.deleteTcTeacherById(teacherId);
    }

    @Override
    public List<TcTeacher> getNoLoginList() {
        return tcTeacherMapper.getNoLoginList();
    }

    @Override
    public List<ClassTeacher> forClassesList(Map<String, Object> params) {
        return tcTeacherMapper.forClassesList(params);
    }
}
